package com.holyant.goods.dto.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.QueryDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 商品调价申请实体 gds_sku_quote
 * 
 * @author g
 * @date 2022-02-09
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("商品调价申请")
public class GdsSkuQuoteQueryDto extends QueryDto {

    private static final long serialVersionUID = 1L;

    /** 编码 */
    @ApiModelProperty(value = "调价申请编码")
    private String code;
    /** 报价类型(10成本价20结算价) */
    @ApiModelProperty(value = "报价类型(10成本价20结算价)")
    private Integer quoteType;
    /** 店铺id */
    @ApiModelProperty(name = "店铺id")
    private Long shopId;
    /** 店铺名称 */
    @ApiModelProperty(name = "店铺名称")
    private String shopName;
    /** 客户id */
    @ApiModelProperty(name = "客户id")
    private Long customerId;
    /** 客户名称 */
    @ApiModelProperty(name = "客户名称")
    private String customerName;

    /**
     * 平台
     */
    private String platform;

    /** 企业id */
    @ApiModelProperty(value = "企业id")
    private Long enterpriseId;
    /** 企业名称 */
    @ApiModelProperty(value = "企业名称")
    private String enterpriseName;
    /** 渠道 */
    @ApiModelProperty(value = "渠道")
    private Integer salesChannel;
    /** 申请时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "申请时间")
    private LocalDateTime applyTime;
    /** 有效时间开始 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "有效时间开始")
    private LocalDate effectiveTimeStart;
    /** 有效时间结束 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "有效时间结束")
    private LocalDate effectiveTimeEnd;
    private LocalDate effectiveTimeStartLessEqualThan;
    private Boolean effectiveTimeEndIsNull;
    /** 审核状态  10 待审核 50 审核中  100 已审核 */
    @ApiModelProperty(value = "审核状态  10 待审核 50 审核中  100 已审核")
    private Integer auditStatus;
    /** 审核人id */
    @ApiModelProperty(value = "审核状态  10 待审核 50 审核中  100 已审核")
    private Long auditById;
    /** 审核人名称 */
    @ApiModelProperty(value = "审核人名称")
    private String auditByName;
    /** 审核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "审核时间")
    private LocalDateTime auditTime;
    /** 更新标记 0：未更新、1：已更新 */
    @ApiModelProperty(value = "审核时间")
    private String updateFlag;
    /** 停用标签 */
    @ApiModelProperty(value = "停用标签")
    private String closeFlag;
    /** 描述 */
    @ApiModelProperty(value = "描述")
    private String remark;
    /** 版本号 */
    @ApiModelProperty(value = "描述")
    private Long ver;
    /** skuid */
    @ApiModelProperty(value = "渠道")
    private Long skuId;
    @ApiModelProperty(value = "商品id")
    private Long goodsId;
    /** 商品名称 */
    @ApiModelProperty(value = "商品名称")
    private String goodsName;
    /** 商品条码 */
    @ApiModelProperty(value = "商品条码")
    private String goodsBarcode;
    /** 所属分类id */
    @ApiModelProperty(value = "所属分类id")
    private Long categoryId;
    /** 所属分类名称 */
    @ApiModelProperty(value = "所属分类名称")
    private String categoryName;
    /** 所属分类编码 */
    @ApiModelProperty(value = "所属分类编码")
    private String categoryCode;
    /** 品牌id */
    @ApiModelProperty(value = "品牌id")
    private Long brandId;
    /** 品牌名称 */
    @ApiModelProperty(value = "品牌名称")
    private String brandName;
    @ApiModelProperty(value = "币种")
    private Integer curType;
    @ApiModelProperty(value = "报价方式 10：包邮不包税，20：包邮包税，30: 不包邮不包税")
    private Integer quoteMethod;
    private String skuCode;

    @ApiModelProperty(value = "审核人id")
    private Long preAuditById;
    /** 审核人名称 */
    @ApiModelProperty(value = "初审人名称")
    private String preAuditByName;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建开始时间")
    private LocalDateTime createTimeStart;

    @ApiModelProperty(value = "创建结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTimeEnd;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "审核开始时间")
    private LocalDateTime auditTimeStart;

    @ApiModelProperty(value = "审核结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime auditTimeEnd;

    private String instanceId;

    @ApiModelProperty(value = "创建人Id")
    private Long createById;

    private String specsQtyEnumName;


    /**
     * 根据生效时间和失效时间进行查询
     */
    private LocalDate createTimeStartAndEnd;


    private Boolean effectiveDateEndIsNotNull;
    public void hasEffectiveDateEndIsNotNull(){
        this.effectiveDateEndIsNotNull=(null != effectiveTimeEnd)? true : false;
    }
}
